import com.vhly.util.DeviceInfo;

import javax.microedition.lcdui.Graphics;
import javax.microedition.lcdui.Image;

final class cls_j extends cls_w {

    private int d;
    private long e;
    cls_u a;
    cls_u fld_b_u;
    private cls_u f;
    private cls_k g;
    private Image img88;
    private int i;
    Image c[];
    private cls_aa j;

    public cls_j(MainThread thread) {
        super(thread);
        super.K = 22;
        super.L = 25;
        f = new cls_u(169, 89);
        f.l = 250;
        f.j = 3;
        fld_b_u = new cls_u(41, 91);
        a = new cls_u(41, 91, thread.r(15));
        short[] shorts = {182, 183, 184, 185, 241, 242};
        I.b[22] = new cls_h(mainThread, (short) 161, shorts, (short) 5, (short) 6, 4);
        I.b[12] = new cls_h(mainThread, (short) 243, new short[10], (short) 5, (short) 4, 7);
        shorts = new short[]{255, 0};
        I.b[23] = new cls_h(mainThread, (short) 253, shorts, (short) 3, (short) 6, 9);
        I.b[23].a((short) 254);
        I.b[24] = new cls_h(mainThread, (short) 0, (short) 5, (short) 6, 6);
        I.b[24].A = new short[1][];
        I.b[24].A[0] = (new short[]{
                64, 1
        });
    }

    final void b(int l, int i1) {
        if ((l & 0x20000) != 0 || (l & 0x1020) != 0) {
            if (super.I.a.fld_b_int == 9 && (l & 0x1000) != 0) {
                super.I.a.c(l);
                return;
            }
            switch (i1) {
                case 24: // '\030'
                    super.mainThread.k(4);
                    return;

                case 22: // '\026'
                    super.mainThread.recordManager.savePrefs();
                    if (++super.mainThread.O >= 2) {
                        if (super.mainThread.recordManager.q) {
                            super.mainThread.k(3);
                            return;
                        }
                        if (super.mainThread.C) {
                            super.mainThread.gameState = 14;
                            return;
                        } else {
                            super.mainThread.k(0);
                            return;
                        }
                    } else {
                        super.I.b[22].r = 4;
                        return;
                    }

                case 23: // '\027'
                    super.mainThread.recordManager.v = (new String(super.I.b[23].B[0])).trim();
                    super.mainThread.recordManager.p[super.mainThread.aq] = super.mainThread.recordManager.v;
                    super.mainThread.recordManager.saveStats();
                    super.mainThread.recordManager.savePrefs();
                    super.I.a(12);
                    super.I.a.fld_q_short = 5;
                    super.I.a.r = 6;
                    return;

                case 12: // '\f'
                    if (super.I.a.r == 6) {
                        super.I.a(24);
                        super.I.a.fld_q_short = 3;
                        super.I.a.r = 4;
                        return;
                    }
                    break;

                default:
                    super.b(l, i1);
            }
        } else if ((l & 0x40000) != 0 || (l & 0x40) != 0)
            switch (i1) {
                case 24: // '\030'
                    super.I.e();
                    return;

                case 22: // '\026'
                    if ((l & 0x40) != 0)
                        if (++super.mainThread.O >= 2) {
                            if (super.mainThread.recordManager.q) {
                                super.mainThread.k(3);
                                return;
                            }
                            if (super.mainThread.C) {
                                super.mainThread.gameState = 14;
                                return;
                            } else {
                                super.mainThread.k(0);
                                return;
                            }
                        } else {
                            super.I.b[22].r = 4;
                            return;
                        }
                    if (--super.mainThread.O < 0)
                        super.mainThread.O = 0;
                    super.I.b[22].r = (short) (super.mainThread.O != 0 ? 4 : 6);
                    return;

                case 12: // '\f'
                    if (super.I.a.r == 4) {
                        super.I.e();
                        return;
                    }
                    if ((l & 0x40) != 0) {
                        super.mainThread.k(4);
                        return;
                    }
                    break;

                default:
                    super.b(l, i1);
            }
        else
            super.b(l, i1);
    }

    final void b_(int l) {
        super.b_(l);
        if (l == 9 && super.mainThread.gameState != 6) {
            c = null;
            g = null;
            img88 = null;
        }
    }

    final void d(int l) {
        super.d(l);
        switch (l) {
            default:
                break;

            case 9:
                if (c == null) {
                    l = 3;
                    int i1 = -1;
                    if (super.mainThread.U > 0 && super.mainThread.T % 3 == 0) {
                        l++;
                        i1--;
                    }
                    c = new Image[l];
                    for (int k1 = 0; k1 < l; k1++)
                        c[k1] = MainThread.loadUnencodeImage(81 + super.mainThread.U + i1++);

                    img88 = MainThread.loadUnencodeImage(88);
                    g = new cls_k(89, 3);
                    g.e = 100;
                    j = new cls_aa(0, DeviceInfo.DEVICE_SCREEN_HEIGHT - c[0].getHeight() >> 1);
                    if (super.mainThread.U > 0 && super.mainThread.T % 3 == 0)
                        j.b(-c[0].getWidth(), DeviceInfo.DEVICE_SCREEN_HEIGHT - c[0].getHeight() >> 1, 12);
                    switch (mainThread.T) {
                        case 0:
                            am[0] = (new short[]{
                                    220, 214, 215
                            });
                            am[1] = (new short[]{
                                    0, 1, 1
                            });
                            break;

                        case 1:
                            am[0] = (new short[]{
                                    218, 219, 216, 217
                            });
                            am[1] = (new short[]{
                                    2, 2, 1, 1
                            });
                            break;

                        case 2:
                            am[0] = (new short[]{
                                    223, 224
                            });
                            am[1] = (new short[]{
                                    24, 13
                            });
                            break;

                        case 5:
                            am[0] = (new short[]{
                                    221
                            });
                            am[1] = (new short[]{
                                    29
                            });
                            break;

                        case 9:
                            am[0] = (new short[]{
                                    226
                            });
                            am[1] = (new short[]{
                                    32
                            });
                            break;

                        case 10:
                            am[0] = (new short[]{
                                    227
                            });
                            am[1] = (new short[]{
                                    21
                            });
                            break;

                        case 11: // '\013'
                            am[0] = (new short[]{
                                    228
                            });
                            am[1] = (new short[]{
                                    21
                            });
                            break;

                        case 12: // '\f'
                            am[0] = (new short[]{
                                    225
                            });
                            am[1] = (new short[]{
                                    10
                            });
                            break;

                        case 14: // '\016'
                            am[0] = (new short[]{
                                    222
                            });
                            am[1] = (new short[]{
                                    27
                            });
                            break;

                        case 17: // '\021'
                            am[0] = (new short[]{
                                    229
                            });
                            am[1] = (new short[]{
                                    20
                            });
                            break;

                        case 3:
                        case 4:
                        case 6:
                        case 7:
                        case 8:
                        case 13:
                        case 15:
                        case 16:
                        default:
                            am[1] = null;
                            am[0] = null;
                            return;
                    }
                }
                break;

            case 12: // '\f'
                super.mainThread.cm = null;
                super.mainThread.fld_m_Vector.removeAllElements();
                super.mainThread.k();
                super.mainThread.recordManager.a(4, (int) super.mainThread.bR, -1);
                super.mainThread.cb = MainThread.bP + 1200L;
                super.mainThread.ap = 0;
                if (super.mainThread.T + 1 == 18) {
                    if (super.mainThread.recordManager.r)
                        super.mainThread.cx = (new short[]{
                                237, 238
                        });
                    else
                        super.mainThread.cx = (new short[]{
                                237, 231, 238
                        });
                    super.mainThread.C = true;
                    super.mainThread.B = false;
                    super.mainThread.recordManager.d = super.mainThread.T = super.mainThread.U = 0;
                    super.mainThread.recordManager.r = true;
                    super.I.c();
                    String sl = super.mainThread.recordManager.i;
                    for (int j1 = 0; j1 < 6; j1++) {
                        super.I.b[24].B[j1] = new char[10];
                        for (int l1 = 0; l1 < 10; l1++)
                            super.I.b[24].B[j1][l1] = sl.charAt(j1 * 10 + l1);

                    }

                    super.mainThread.q(0);
                    if (!super.mainThread.co.contains(sl)) {
                        super.mainThread.co.addElement(sl);
                        super.mainThread.cp.addElement(new Integer(0));
                        super.mainThread.recordManager.g();
                    }
                }
                for (l = 0; l < super.mainThread.ch.length; l++) {
                    if (l == 2)
                        super.mainThread.cf[l] = super.mainThread.al;
                    else
                        super.mainThread.cf[l] = super.mainThread.ch[l] - super.mainThread.cg[l];
                    super.mainThread.ce[l] = 0;
                    super.mainThread.cg[l] = super.mainThread.ch[l];
                }

                if (super.mainThread.C) {
                    super.mainThread.recordManager.u = 5;
                    super.mainThread.cB = super.mainThread.strs[213];
                } else {
                    if (super.mainThread.U == 0 || (super.mainThread.T + 1) % 3 == 0)
                        super.mainThread.recordManager.q = true;
                    super.mainThread.recordManager.d = super.mainThread.T + 1;
                    super.mainThread.recordManager.saveStats();
                    super.mainThread.cB = super.mainThread.strs[124] + Integer.toString(super.mainThread.T + 1) + super.mainThread.strs[125];
                }
                super.mainThread.recordManager.saveStats();
                super.mainThread.recordManager.savePrefs();
                return;

            case 7:
                super.J.a(28 + super.mainThread.U, true);
                if ((super.mainThread.ck.H & 4) != 0) {
                    super.I.a.fld_q_short = 7;
                    return;
                }
                if ((super.mainThread.ck.H & 0x20) != 0) {
                    super.I.a.fld_q_short = 8;
                    return;
                }
                if ((super.mainThread.ck.H & 0x100) != 0) {
                    super.I.a.fld_q_short = 9;
                    return;
                }
                if ((super.mainThread.ck.H & 0x800) != 0)
                    super.I.a.fld_q_short = 10;
                break;
        }
    }

    final void a() {
        super.mainThread.fld_m_Vector.removeAllElements();
        super.mainThread.i();
        super.mainThread.ck.o = new cls_aa(88, 104);
        super.mainThread.ci.a = super.mainThread.ck.o.a - ((88) << 8);
        super.mainThread.ci.b = super.mainThread.ck.o.b - ((104) << 8);
        super.mainThread.cn = super.mainThread.ck;
        for (int l = 0; l < 38; l++) {
            int i1;
            if ((i1 = super.mainThread.cD[l][super.mainThread.T]) > 0 && l != 27) {
                i1 = (i1 *= 262) >> 8;
                i1 = Math.max(1, i1);
            }
            for (int j1 = 0; j1 < i1; j1++) {
                cls_d d1 = new cls_d(super.mainThread, l, super.mainThread.j(super.mainThread.cz), super.mainThread.j(super.mainThread.cy));
                (d1).l = d1.fld_m_int = super.mainThread.j(256);
                d1.d = 2;
                super.mainThread.fld_m_Vector.addElement(d1);
                super.mainThread.a(d1);
                if (!d1.v)
                    continue;
                int k1 = MainThread.a(super.mainThread.ck.o, d1.o);
                d1.o.a += (super.mainThread.cz >> 1) * MainThread.g(k1);
                d1.o.b += (super.mainThread.cy >> 1) * MainThread.f(k1);
                if ((d1.H & 0x40) == 0)
                    continue;
                for (int l1 = 0; l1 < d1.q.length; l1++) {
                    d1.q[l1].a = d1.o.a;
                    d1.q[l1].b = d1.o.b;
                }

            }

            super.mainThread.a();
        }

    }

    final void a(int l, int i1) {
        label0:
        {
            if ((l & 0x1ef1e) != 0) {
                if (l != d)
                    d = l;
                e = super.mainThread.bR + 800L;
            }
            if ((i1 & 0x1ef1e) != 0 && i1 == d) {
                d = i1;
                if (e > super.mainThread.bR) {
                    if ((super.mainThread.ck.H & 1) != 0 && super.mainThread.ck.M[6] < super.mainThread.bR) {
                        super.mainThread.ck.M[6] = super.mainThread.bR + 1500L;
                        super.mainThread.bl[super.mainThread.ck.f].b = 0;
                    }
                    if ((super.mainThread.ck.H & 2) != 0 && super.mainThread.ck.M[7] < super.mainThread.bR)
                        super.mainThread.ck.M[7] = super.mainThread.bR + 1500L;
                }
            }
            if (super.mainThread.ck.u) {
                MainThread acl = super.mainThread;
                if (Math.abs(i1 = (acl).ck.fld_m_int - ((acl).ck.n != 0 ? (acl).ck.n : 256)) <= (acl).ck.A) {
                    (acl).ck.fld_m_int = (acl).ck.n;
                    (acl).ck.u = false;
                    (acl).ck.d = (acl).ck.P;
                } else if ((0xff & i1) < 128)
                    (acl).ck.fld_m_int -= (acl).ck.A;
                else
                    (acl).ck.fld_m_int += (acl).ck.A;
                (acl).ck.fld_m_int = 0xff & (acl).ck.fld_m_int;
                (acl).ck.l = (acl).ck.fld_m_int;
                return;
            }
            if (super.mainThread.B)
                return;
            boolean flag = super.mainThread.ck.M[3] > super.mainThread.bR || super.mainThread.ck.M[5] > super.mainThread.bR;
            if (!flag) {
                boolean flag1 = super.mainThread.ck.g(32);
                if ((l & 0x1020) != 0) {
                    super.mainThread.H = false;
                    super.mainThread.I = true;
                }
                if (((l & 0x20000) != 0 || (l & 0x80) != 0) && super.mainThread.ck.Q < super.mainThread.bR)
                    i();
                if ((i1 & 0x1020) != 0) {
                    if (super.mainThread.I)
                        super.mainThread.H = true;
                    if (flag1)
                        super.mainThread.ck.N = false;
                }
                if (super.mainThread.H && super.mainThread.cl != null && super.mainThread.ck.B > super.mainThread.cl.B) {
                    if (super.mainThread.ck.c == null)
                        super.mainThread.ck.c = super.mainThread.cl;
                    l = MainThread.a(super.mainThread.ck.o, super.mainThread.ck.c.o);
                    int j1;
                    if ((super.mainThread.ck.H & 0x80) != 0) {
                        super.mainThread.ck.fld_m_int = super.mainThread.ck.l = l;
                        super.mainThread.ck.d = super.mainThread.ck.e << 1;
                    } else if ((j1 = 0xff & super.mainThread.ck.fld_m_int - l) < 64 || j1 > 192)
                        super.mainThread.ck.d = super.mainThread.ck.e << 1;
                    else
                        super.mainThread.ck.c();
                    if (super.mainThread.bS < super.mainThread.bR && super.mainThread.I)
                        super.mainThread.bS = super.mainThread.bR + 2000L;
                    super.mainThread.bT = super.mainThread.bS;
                    super.mainThread.I = false;
                }
                if (!flag1) {
                    l = super.mainThread.m(super.mainThread.ck.fld_m_int);
                    if (super.mainThread.ck.M[0] > super.mainThread.bR) {
                        if ((i1 & 0x808) != 0 || (i1 & 0x2010) != 0 || (i1 & 0x202) != 0 || (i1 & 0x8004) != 0 || (i1 & 0x100) != 0 || (i1 & 0x400) != 0 || (i1 & 0x4000) != 0 || (i1 & 0x10000) != 0)
                            l = 0xff & l - 128;
                    } else if (super.mainThread.ck.fld_m_int == (0xff & l - 128)) {
                        super.mainThread.ck.u = true;
                        super.mainThread.ck.n = l;
                        super.mainThread.ck.P = super.mainThread.ck.d;
                        super.mainThread.ck.d = 0;
                    }
                    if (super.mainThread.ck.fld_m_int != l) {
                        int k1;
                        if (Math.abs(k1 = super.mainThread.ck.fld_m_int - l) <= super.mainThread.ck.A)
                            super.mainThread.ck.fld_m_int = l;
                        else if ((0xff & k1) < 128)
                            super.mainThread.ck.fld_m_int -= super.mainThread.ck.A;
                        else
                            super.mainThread.ck.fld_m_int += super.mainThread.ck.A;
                        super.mainThread.ck.fld_m_int = 0xff & super.mainThread.ck.fld_m_int;
                    }
                    if ((i1 & 0x1ef1e) == 0) {
                        if (super.mainThread.ck.d > 2 && super.mainThread.bT < super.mainThread.bR && !super.mainThread.ck.y) {
                            i1 = (960 << 8) / 1000;
                            super.mainThread.ck.d = Math.max(i1 * super.mainThread.ck.d >> 8, 2);
                        }
                        break label0;
                    }
                    super.mainThread.bT = 0L;
                    super.mainThread.ck.c = null;
                    super.mainThread.ck.b();
                    super.mainThread.ck.b();
                    super.mainThread.ck.b();
                }
                return;
            }
            if (super.mainThread.ck.M[3] > super.mainThread.bR) {
                if ((l & 0x1020) != 0) {
                    super.mainThread.recordManager.t = true;
                    super.mainThread.bZ = 0L;
                    super.mainThread.ck.M[3] -= 200L;
                    super.mainThread.ck.fld_m_int = 0xff & super.mainThread.ck.fld_m_int + (super.mainThread.j(10) - 4);
                    super.mainThread.ck.o.a += (super.mainThread.j(10) - 4) << 8;
                    super.mainThread.ck.o.b += (super.mainThread.j(10) - 4) << 8;
                    if (super.mainThread.recordManager.b) {
                    }
                }
            } else if (super.mainThread.ck.M[5] > super.mainThread.bR && (super.mainThread.P & 1) == 0) {
                super.mainThread.ck.l = 0xff & super.mainThread.ck.l + (super.mainThread.j(64) - 32);
                super.mainThread.ck.fld_m_int = 0xff & super.mainThread.ck.fld_m_int + (super.mainThread.j(64) - 32);
            }
        }
    }

    final void a(int ai[]) {
        b(ai);
    }

    final void b() {
        if (super.mainThread.ck.B <= super.mainThread.cC[1][3])
            super.mainThread.gameState = 13;
    }

    final void c() {
        super.mainThread.a(super.mainThread.bufferGraphics, 390);
    }

    final void d() {
        if (super.mainThread.ca < MainThread.bP) {
            if (!super.mainThread.recordManager.a || super.mainThread.recordManager.a && super.J.c[24].c == 0 || super.mainThread.ca < MainThread.bP - 2800L) {
                super.I.b(22);
                super.I.b[22].r = 6;
                super.mainThread.O = 0;
                if (super.mainThread.cf[5] > 0) {
                    super.J.a((byte) 25, false);
                }
            } else {
                super.mainThread.a(super.mainThread.bufferGraphics, 16902);
            }
        } else {
            if (super.mainThread.cb < MainThread.bP && super.mainThread.ap < 2) {
                super.mainThread.cb += 1200L;
                super.mainThread.ap++;
                int l = super.mainThread.j(176) - 88;
                int j1 = super.mainThread.j(52);
                cls_d d1 = new cls_d(super.mainThread, 50, (super.mainThread.cn.o.a >> 8) + l, (super.mainThread.cn.o.b >> 8) - j1);
                d1.a(16, super.mainThread.j(11));
            }
            for (int i1 = 0; i1 < super.mainThread.fld_m_Vector.size(); i1++) {
                cls_d d2;
                (d2 = (cls_d) super.mainThread.fld_m_Vector.elementAt(i1)).b();
                d2.e(1);
                super.mainThread.a(d2);
            }

            super.mainThread.a(super.mainThread.bufferGraphics, 16902);
        }
    }

    final void a(Graphics g1) {
        boolean flag = false;
        if (super.mainThread.bS > super.mainThread.bR) {
            if (super.mainThread.ak > 0)
                flag = true;
        } else {
            if (super.mainThread.bT > super.mainThread.bR) {
                super.mainThread.bT = 0L;
                super.mainThread.ck.c = null;
                super.mainThread.ck.d >>= 1;
            }
            super.mainThread.H = false;
            super.mainThread.ak = 0;
        }
        g1.drawImage(super.img1, 0, 0, 20);
        if (super.mainThread.T % 3 == 2 && super.ak.f < super.mainThread.bR) {
            super.ak.a += super.ak.a != super.mainThread.T % 3 ? -1 : 1;
            super.ak.f = super.mainThread.bR + (long) super.ak.e;
        }
        super.ak.a(g1, 0, 0, super.ak.a, 20);
        int i1 = Math.min((super.mainThread.ai * 100) / inf_m.ab[super.mainThread.T], 100);
        a(g1, i1);
        if (flag || i > 0) {
            g1.setClip(super.N, 0, super.M, DeviceInfo.DEVICE_SCREEN_HEIGHT);
            i1 = super.N;
            if (flag)
                i = Math.min(i + 85, 255);
            else
                i = Math.max(i - 85, 0);
            do
                g1.drawImage(super.img26, i1, 2 + (super.aj.d >> 1), 6);
            while ((i1 += super.img26.getWidth()) < super.O);
        }
        g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
        i1 = ((super.mainThread.ck.B - super.mainThread.cC[1][3] << 8) / (65 - super.mainThread.cC[1][3]) * 100 >> 8) * 5 / 100;
        int l;
        for (l = 0; l < i1; l++) {
            g1.drawImage(super.U, DeviceInfo.DEVICE_SCREEN_WIDTH - (super.U.getWidth() - 1) * l - 3, super.img102.getHeight() >> 1, 10);
        }
        if (i1 < 5 && (i1 = (super.mainThread.aj << 8) / super.mainThread.ck.B * 100 >> 8) > 0) {
            i1 = Math.min(super.U.getWidth() - 3, (i1 * super.U.getWidth()) / 100);
            l = DeviceInfo.DEVICE_SCREEN_WIDTH - (super.U.getWidth() - 1) * l - 3;
            g1.setClip(l - i1, 0, i1, DeviceInfo.DEVICE_SCREEN_HEIGHT);
            g1.drawImage(super.U, l, super.img102.getHeight() >> 1, 10);
        }
        if (super.mainThread.bZ > super.mainThread.bR) {
            f.a(g1, 88, DeviceInfo.DEVICE_SCREEN_HEIGHT, f.b, 0, 33);
            f.a(super.mainThread.bR);
        }
    }

    final void c(Graphics g1) {
        for (int l = 0; l < super.vector.size(); l++) {
            cls_u u1 = (cls_u) super.vector.elementAt(l);
            int i1 = (u1.n.a - super.mainThread.ci.a) >> 8;
            int j1 = (u1.n.b - super.mainThread.ci.b) >> 8;
            u1.a(g1, i1, j1, u1.b - 1, 0, 3);
            if (u1.a.equals(super.mainThread.bc)) {
                int i2 = super.mainThread.cn.o.a - super.mainThread.ci.a;
                int k1 = (i2) >> 8;
                i2 = super.mainThread.cn.o.b - super.mainThread.ci.b;
                i2 = (i2) >> 8;
                if (k1 >= i1 - (u1.f >> 1) && k1 <= i1 + (u1.f >> 1) && i2 >= j1 - (u1.g >> 1) && i2 <= j1 + (u1.g >> 1)) {
                    super.mainThread.F = super.mainThread.bR;
                    super.mainThread.G = Math.min(super.mainThread.G + 19, 255);
                }
            }
            if (super.mainThread.bR - u1.m <= (long) u1.l)
                continue;
            if (++u1.b > u1.i)
                super.vector.removeElementAt(l--);
            u1.m = super.mainThread.bR;
        }

    }

    final void a(int l) {
        c = null;
        g = null;
        img88 = null;
        super.ak = null;
        f = null;
        if (l != 3){
            (super.mainThread.recordManager).loadStats(false);
        }
    }

    private void i() {
        if ((super.mainThread.ck.H & 0x800) != 0) {
            super.mainThread.ck.N = true;
            super.mainThread.ck.Q = super.mainThread.bR + 10000L;
            byte byte0 = 19;
            super.J.a(byte0, false);
            int l = super.mainThread.fld_m_Vector.size();
            for (int i1 = 0; i1 < l; i1++) {
                cls_d d3;
                if ((d3 = (cls_d) super.mainThread.fld_m_Vector.elementAt(i1)).s == 1) {
                    d3.c = super.mainThread.ck;
                    d3.fld_m_int = d3.l = MainThread.a(d3.o, super.mainThread.ck.o);
                    continue;
                }
                if (d3.s == 7 && !d3.N) {
                    d3.N = true;
                    d3.Q = super.mainThread.bR;
                }
            }

            return;
        }
        if ((super.mainThread.ck.H & 4) != 0) {
            cls_d d1 = super.mainThread.ck;
            int j1 = 100;
            int k1 = 2;
            super.mainThread.o.removeAllElements();
            do {
                cls_d d2;
                if ((d2 = super.mainThread.b(d1, j1 * j1, 33)) == null)
                    break;
                super.mainThread.o.addElement(d2.o);
                d2.b(1, 3000);
                d2.f(k1);
                d1 = d2;
                j1 -= 5;
                k1 <<= 1;
            } while (j1 > 0);
            if (super.mainThread.o.size() > 0) {
                super.mainThread.o.insertElementAt(super.mainThread.ck.o, 0);
                super.mainThread.bY = super.mainThread.bR + 1000L;
                byte byte1 = 16;
                super.J.a(byte1, false);
            }
            super.mainThread.ck.Q = super.mainThread.bR + 10000L;
            super.mainThread.bn[super.mainThread.ck.f].j = 0;
            super.mainThread.bG.b = 0;
            super.mainThread.bG.a(0, super.mainThread.bG.e);
            return;
        }
        if ((super.mainThread.ck.H & 0x100) != 0) {
            super.mainThread.bU = super.mainThread.bR + 6000L;
            super.mainThread.ck.Q = super.mainThread.bR + 10000L;
            byte byte2 = 20;
            super.J.a(byte2, false);
            return;
        }
        if ((super.mainThread.ck.H & 0x20) != 0) {
            super.mainThread.ck.N = true;
            super.mainThread.ck.Q = super.mainThread.bR + 10000L;
            super.mainThread.ck.C = 3;
            super.mainThread.ck.a();
            byte byte3 = 9;
            super.J.a(byte3, false);
        }
    }

    final void b(Graphics g1) {
        String s;
        s = cls_b.a(/*s = */super.mainThread.strs[super.am[0][super.mainThread.an]]);
        super.mainThread.u.a(g1, s, 96, DeviceInfo.DEVICE_SCREEN_HEIGHT - super.mainThread.img24.getHeight() - 30, 33);
    }

    final void d(Graphics g1) {
        j.b();
        int l = c[0].getWidth();
        int i1 = c.length;
        int j1 = l * 3;
        int l1 = DeviceInfo.DEVICE_SCREEN_WIDTH - j1 >> 1;
        g1.setColor(0);
        g1.fillRect(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
        g1.setClip(l1, 0, j1, DeviceInfo.DEVICE_SCREEN_HEIGHT);
        for (j1 = 0; j1 < i1; j1++) {
            g1.drawImage(c[j1], (j.a >> 8) + l1 + l * j1, j.b >> 8, 20);
        }

        j1 = l1 + l + (super.mainThread.T % 3 + 1) * (img88.getWidth() / 3) + 2;
        if (i1 == 4)
            j1 += l + ((j.a) >> 8);
        g1.setClip(l1, 0, j1 - l1, DeviceInfo.DEVICE_SCREEN_HEIGHT);
        for (int j2 = 0; j2 < i1; j2++) {
            int i2 = ((j.a) >> 8) + l1 + l * j2;
            int k1 = ((((j.b) >> 8) - (DeviceInfo.DEVICE_SCREEN_HEIGHT - c[0].getHeight())) + 156) - (super.mainThread.U + j2) * (img88.getHeight() >> 1);
            if ((super.mainThread.U != 0 && (super.mainThread.U != 1 || i1 != 4) || j2 <= 0) && (super.mainThread.U != 1 || i1 != 3) && super.mainThread.U <= 1)
                continue;
            g1.drawImage(img88, i2, k1, 20);
            if (j2 == i1 - 1) {
                g.a(g1, i2, k1 + (g.d >> 1), 24);
                long l3 = MainThread.bP;
                cls_k kk1 = g;
                if (g.e > 0) {
                    if (l3 - (kk1).f <= (long) (kk1).e)
                        continue;
                    kk1.f = l3;
                }
                kk1.a();
            } else {
                g.a(g1, i2, k1 + (g.d >> 1), 0, 24);
            }
        }

        g1.setClip(0, 0, DeviceInfo.DEVICE_SCREEN_WIDTH, DeviceInfo.DEVICE_SCREEN_HEIGHT);
        super.mainThread.u.a(g1, super.mainThread.strs[170 + super.mainThread.U] + Integer.toString(super.mainThread.T + 1), 22, 26, 20);
        super.mainThread.a(g1);
    }

    final boolean e() {
        if (super.mainThread.gameState != 14)
            if (super.am[1] != null && ++super.mainThread.an < super.am[1].length) {
                super.mainThread.p(super.am[1][super.mainThread.an]);
                return false;
            } else {
                super.am[1] = null;
                super.am[0] = null;
                return true;
            }
        if (++super.mainThread.an >= super.mainThread.cx.length) {
            super.mainThread.C = false;
            super.mainThread.aq = super.mainThread.recordManager.a(super.mainThread.recordManager.k[5], super.mainThread.R);
            if (super.mainThread.aq >= 0) {
                System.arraycopy(super.mainThread.recordManager.v.toCharArray(), 0, super.I.b[23].B[0], 0, super.mainThread.recordManager.v.length());
                super.I.b(23);
            } else {
                super.I.b(12);
                super.I.a.fld_q_short = 5;
                super.I.a.r = 6;
            }
        }
        return true;
    }

    final void f() {
        super.f();
        if (super.mainThread.gameState != 14) {
            super.mainThread.p(super.am[1][super.mainThread.an]);
            return;
        }
        int l = super.mainThread.recordManager.k[5];
        super.mainThread.C = false;
        super.mainThread.aq = super.mainThread.recordManager.a(l, super.mainThread.R);
        if (super.mainThread.aq >= 0)
            super.I.b(23);
        else
            super.I.b(12);
        super.I.a.fld_q_short = 5;
        super.I.a.r = 6;
    }
}